Windows Installer XML Toolset (WiX)


Windows Installer XML Toolset (WiX)

It is a free software that can be used to build Windows Installer packages (*.msi files) using XML. WiX is a collection of line commands to can be run from the MSDOS prompt. WiX can also be integrated with Microsoft Visual Studio. WiX may create CAB files that can optionally be embedded inside the MSI file.
Es un software libre que puede ser usado para crear paquetes de instalación de Windows (*.msi) usando XML. WiX es una colección de comando de línea que puede ser ejecutados desde la consola de MSDOS. WiX puede también ser integrado con Microsoft Visual Studio. WiX puede crear archivo CAB que pueden opcionalmente embeberse dentro del archivo MSI.

Tip
WiX uses GUIDs to identify each part of a WiX file, you can use Microsoft Visual Studio to generate GUIDs or you can generate them programmatically, see Wintempla > COM > GUID. You can run guidgen.exe to generate a GUID.
WiX usa GUIDs para identificar cada parte del archivo WiX, usted puede usar Microsoft Visual Studio para generar GUIDs o usted puede generarlas en forma programática, ver Wintempla > COM > GUID. Usted puede ejecutar guidgen.exe para generar una GUID.

Problem 1
Download and install WiX toolset (the Microsoft Visual Extension and the WiX executable installation program, WiX311.exe). Each setup project creates a WXS file that is an XML file. The file can be edited inside Microsoft Visual Studio.
Descarge e instale WiX toolset (la extensión para Microsoft Visual y el ejecutable de instalación WiX, WiX311.exe).. Cada proyecto de instalación crea un archivo WXS el cual es un archivo de XML. El archivo puede ser editado dentro de Microsoft Visual Studio.

WiX Toolset Components

A basic WiX toolset file has five parts:
  1. Directory Structure This component is responsible of creating (and removing) the main folder of the application. Typically, this folder is: C:\Program Files\Program Name
  2. Files This component is responsible of copying (and deleting) the applications files inside the application folder.
  3. Application Shortcut This component is responsible of creating a shortcut to the application, so that the user can easily find our application
  4. File Associations This component is responsible of associating a specific file extension with the application so that the application is automatically executed when the user double clicks a file with this extension
  5. Perform Actions This component is responsible of executing the actions described in the previous components. As each component as an ID, it is possible to perform the action using the ID of the component.

Un archivo básico de WiX toolset tiene cinco partes.
  1. Estructura del Directorio Este componente es responsable de crear (y remover) la carpeta principal de la aplicación. Típicamente este folder es: C:\Program Files\Nombre Programa
  2. Archivos Este componente es responsable de copiar (y borrar) los archivos de la aplicación dentro de la carpeta de la aplicación.
  3. Acceso Directo de la Aplicación Este componentes es responsable de crear un acceso directo a la aplicación, de tal forma que el usuario pueda fácilmente encontrar nuestra aplicación.
  4. Asociación de Archivos Este componente es responsable de asociar una extensión específica con la aplicación, de tal forma que la aplicación se ejecute automáticamente cuando el usuario hace doble clic en el archivo con esta extensión.
  5. Ejecución de Acciones Este componente es responsable de ejecutar las acciones descritas en los componentes previos. Como cada componente tiene una ID, es posible ejecutar una acción usando el ID del componente.

GUID

WiX toolset uses IDs in a very specific format called GUID. To generate a GUID inside Microsoft Visual Studio use: TOOLS > Create GUID . You MUST generate an ID for each component in the WiX toolset file. You CANNOT use a GUID that you see in a file; you MUST generate your own GUID.
WiX toolset utiliza IDs en un formato específico llamado GUID. Para generar una GUID dentro de Microsoft Visual Studio use: TOOLS > Create GUID . Usted debe generar una ID para cada componente en el archivo de WiX toolset. Usted NO PUEDE usar una GUID que vea en un archivo; usted DEBE generar su propia GUID.

Problem 2
Create a Wintempla dialog application called MyProduct. Run the program. We will create a setup program using WIX for this application in the next problem.
Cree una aplicación de diálogo de Wintempla llamada MyProduct. Corra el programa. Nosotros crearemos un programa de instalación usando WIX para esta aplicación en el problema siguiente.

Problem 3
Open Solution Explorer and select the MyProduct solution. With the mouse open the context menu to select: Add > New Project > Windows Installer XML > Setup Project &. Set the project name as shown. The wizard will create a file called Product.wxs.
Abra Solution Explorer y seleccione la solución MyProduct. Con el ratón abra el menú de contexto para seleccionar: Add > New Project > Windows Installer XML > Setup Project &. Fije el nombre del proyecto como se muestra. El asistente creará un archivo llamado Product.wxs.

AddNewProject

SetName

Problem 4
Edit the Product.wxs file as shown. Do not forget to generate your own GUIDs for each WiX component.
Edite el archivo Product.wxs como se muestra. No se olvide de generar sus propias GUIDs para cada componente WiX.

ApplicationInformation

Folders

Files

ApplicationShortcut

Components

Problem 5
Using the Configuration Manager change the configuration from Debug to Release. Build the MyProduct project to generate the file MyProduct.exe in the respective Release folder. Build the project MyProductSetup. Be sure you have the files: MyProduct.exe and MyProduct.ico before building the project MyProductSetup. The file MyProduct.msi will be created in the respective Release folder of the project MyProductSetup.
Usando el Configuration Manager cambie la configuración de Debug a Release. "Build" el proyecto MyProduct para generar el archivo MyProduct.exe en la carpeta respectiva de Release. "Build" el proyecto MyProductSetup. Asegúrese de que usted tiene los archivos: MyProduct.exe y MyProduct.ico antes de construir el proyecto MyProductSetup. El archivo MyProduct.msi se generará en la carpeta respectiva de Release del proyecto MyProductSetup.

KeyPath

The KeyPath of a component is a resource that the Windows Installer uses to determine if a component has been installed on a computer. This implies that before installing a component, the Windows Installer will first look whether the KeyPath resource is already present. If it is, none of the resources in the component will be installed. During an installation repair, the presence of the KeyPath resource also determines whether a component has been damaged or has gone missing. Additionally, when the KeyPath resource is a versioned file, the Windows Installer will consider it to exist only if it finds a file with an equal or higher version.
El KeyPath de un componente es un recurso que el Instalador de Windows usa para determinar si un componente ha sido instalado en una computadora. Esto implica que antes de instalar un componente, el Instalador de Windows primero tratará de encontrar si hay un recurso de KeyPath presente. Si lo hay, entonces ninguno de los recursos del componente se instalarán. Durante una reparación de la instalación, la presencia del recurso de KeyPath también determina cuando un componente se ha dañado o se ha perdido. Adicionalmente, cuando el recurso de KeyPath es un archivo con versión, el Instalador de Windows considerará si existe solamente cuando encuentra un archivo con una versión igual o más alta.

© Copyright 2000-2021 Wintempla selo. All Rights Reserved. Jul 22 2021. Home